package io.renren.modules.web.controller;


import io.renren.common.utils.R;
import io.renren.entity.WebsiteMenuEntity;
import io.renren.modules.web.service.WebsiteMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 官网菜单
 *
 * @author zyj
 * @date 2018-12-28 15:47
 */
@RestController
@RequestMapping("/web/menu")
@Api("官网菜单接口")
public class WebsiteMenuController {

    @Autowired
    private WebsiteMenuService websiteMenuService;



    @GetMapping("/list")
    @ApiOperation("获取官网菜单")
    public R menuList(){
        List<WebsiteMenuEntity> list  = websiteMenuService.queryList();
        return R.ok().put("list",list);
    }

    @GetMapping("/son/menu")
    @ApiOperation("获取子类菜单")
    public R sonmenu(){
        List<WebsiteMenuEntity> list  = websiteMenuService.querySonList();
        return R.ok().put("list",list);
    }


}
